// 内容详情
var wxParser = require('../../wxParser/index');
Page({
  data: { 
      loadHide: true
  },
  onLoad: function(options){
      var id = options.id;
      console.log(id);
      if(parseInt(id) < 1) return;
      var that = this;
      this.setData({loadHide: false});
      wx.BaaS.getContent({ richTextID: id}).then( (res) => {
        wxParser.parse({
            bind: 'richText',
            html: res.data.content,
            target: that,
            enablePreviewImage: true
        });
        that.setData({loadHide: true});
        if(res.data.title){
            wx.setNavigationBarTitle({
                title: res.data.title
            });
        } 
    }, (err) => {
              // err
    });
  },
  onShow: function(){
      console.log("onShow");
  }
})